﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace SHRIS.MIS.Entity.ScadaData
{
    [Table("tb_order")]
    public class OrderEntity : BaseScadaEnetity
    {
        /// <summary>
        /// 记录主键
        /// </summary>
        [Key]
        [Column("OrderId")]
        public Guid Id { get; set; }

        /// <summary>
        /// 发送时间
        /// </summary>
        [Required]
        public DateTimeOffset SendTime { get; set; }


        /// <summary>
        /// 订单编号
        /// </summary>
        [Required]
        public string OrderCode { get; set; }

        /// <summary>
        /// 物料编号
        /// </summary>
        public string MaterialId { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 计划投产数量
        /// </summary>
        [Required]
        public int MaterialQuantity { get; set; }

        /// <summary>
        /// 计划生产数量
        /// </summary>
        [Required]
        public int PlaneQuantity { get; set; }

        /// <summary>
        /// 计划批次数量
        /// </summary>
        public int BatchQuantity { get; set; }

        /// <summary>
        /// 优先级
        /// </summary>
        public int Priority { get; set; }

        /// <summary>
        /// 生产顺序号
        /// </summary>
        public int Sequence { get; set; }

        /// <summary>
        /// 计划开始日期
        /// </summary>
        [Required]
        public DateTimeOffset PlaneDate { get; set; }

        /// <summary>
        /// 计划完成日期
        /// </summary>
        [Required]
        public DateTimeOffset RequiredDate { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }


        /// <summary>
        /// 订单类型
        /// </summary>
        [Required]
        public int OrderType { get; set; }

        /// <summary>
        /// 订单当前状态
        /// </summary>
        [Required]
        public int OrderCurrentStatus { get; set; }
    }
}
